import {view, View, binder} from "adajs";
import CommentService from "./state.js";

@view({
	className: "comment",
	template: "./template.html",
	style: "./style.scss",
	dataset: {
		service: CommentService
	}
})
class Comment extends View {
	@binder("popup")
	popup() {
		this.commit("setPopuped", true);
	}

	@binder("back")
	back() {
		this.commit("setPopuped", false);
	}

	@binder("input")
	input({e}) {
		let text = e.target.value;
		this.commit("setContent", text);
	}
}

export default Comment;